package com.sample.springbatch.job.splitfile;

import com.sample.springbatch.model.RepayOrderInfo;
import org.springframework.batch.support.annotation.Classifier;
import org.springframework.classify.BackToBackPatternClassifier;
import org.springframework.classify.ClassifierAdapter;

import java.util.HashMap;

/**
 * 分区匹配分类器
 *
 * @author zwg
 */
public class RepayOrderInfoZonePatternClassifier extends BackToBackPatternClassifier<RepayOrderInfoZone,RepayOrderInfoZoneWriter> {


    public RepayOrderInfoZonePatternClassifier() {

        HashMap<String, RepayOrderInfoZoneWriter> writers = new HashMap<>();
        writers.put("0",new RepayOrderInfoZoneWriter("0"));
        writers.put("1",new RepayOrderInfoZoneWriter("1"));
        writers.put("2",new RepayOrderInfoZoneWriter("2"));
        writers.put("3",new RepayOrderInfoZoneWriter("3"));

        setMatcherMap(writers);
        setRouterDelegate(new RepayOrderInfoZoneClassifiter());


    }
}
